package org.tailor
/**
 * The Orders entity.
 *
 * @author    
 *
 *
 */
class Orders {
    static mapping = {
        table 'orders'
        // version is set to false, because this isn't available by default for legacy databases
        version false
        id generator:'identity', column:'id'
        transactionIdTrans column:'transaction_id'
        shirtIdShirt column:'shirt_id'
    }
    Long id
    Date requiredDate
    java.math.BigDecimal salesTax
    Date timestamp
    String status
    Integer unit
    java.math.BigDecimal price
    Long discount
    // Relation
    Trans transactionIdTrans
    // Relation
    Shirt shirtIdShirt

    static constraints = {
        id(max: 9223372036854775807L)
        requiredDate()
        salesTax()
        timestamp()
        status(inList: ["notdeliver","delivering","error", "delivered"])
        unit(max: 2147483647)
        price(nullable: true)
        discount(max: 9223372036854775807L)
        transactionIdTrans()
        shirtIdShirt()
    }
    String toString() {
        return "${id}" 
    }
}
